package com.xoa.controller.party;


import com.xoa.model.party.EnCommunityVolunteer;
import com.xoa.service.party.EnCommunityVolunteerService;
import com.xoa.util.ToJson;
import com.xoa.util.common.newwrapper.BaseWrapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 社区志愿者
 * Created by gsb on 2018/1/10.
 */
@Controller
@RequestMapping("/enCommunityVolunteer")
public class EnCommunityVolunteerController {

    @Resource
    private EnCommunityVolunteerService enCommunityVolunteerService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 上午10:30:51
     * 类介绍  :   新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EnCommunityVolunteer> insertSelective(EnCommunityVolunteer enCommunityVolunteer, HttpServletRequest request) {
       return enCommunityVolunteerService.insertSelective(enCommunityVolunteer, request);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 上午10:36:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EnCommunityVolunteer> deleteByPrimaryKey(Integer vid){
        return enCommunityVolunteerService.deleteByPrimaryKey(vid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 上午10:46:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EnCommunityVolunteer> updateByPrimaryKeySelective(EnCommunityVolunteer enCommunityVolunteer) {
        return enCommunityVolunteerService.updateByPrimaryKeySelective(enCommunityVolunteer);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 上午10:46:51
     * 类介绍  :   详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EnCommunityVolunteer> selectById(Integer vid){
        return enCommunityVolunteerService.selectById(vid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 上午11:26:51
     * 类介绍  :   列表
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EnCommunityVolunteer> queryList(EnCommunityVolunteer enCommunityVolunteer, Integer page, Integer pageSize,
                                                  boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export) {
        return enCommunityVolunteerService.queryList(enCommunityVolunteer, page, pageSize, useFlag, request, response, export);
    }

    @RequestMapping("/outPutFile")
    @ResponseBody
    public BaseWrapper outPutFile(HttpServletRequest request, HttpServletResponse response){
        return enCommunityVolunteerService.outPutFile(request,response);
    }

    @RequestMapping("/inPutFile")
    @ResponseBody
    public BaseWrapper inPutFile(MultipartFile file){
        return enCommunityVolunteerService.inPutFile(file);
    }
    }
